/*
 * PGN_Reader : A simple pgn reader for chess games.
 * Copyright (C) 2011 Laurent BERNABE
 * 
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package com.gmail.bernabe.laurent.java_swing.pgn_reader.gui;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JScrollPane;

import com.gmail.bernabe.laurent.java_swing.pgn_reader.processing.PlayingTape;

public class PGNReaderFrame extends JFrame {
	
	public PGNReaderFrame(){
		setTitle("PGN Reader");
		setSize(SIZE);
		setLocationRelativeTo(null);
		setResizable(false);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		boardPanel = new BoardJPanel(this);
		playingTape = new PlayingTape(classic_RuyLopez_PGN, this);
		buttonsPanel = new BoardButtonsJPanel(playingTape);
		setLayout(new BorderLayout());
		add(boardPanel, BorderLayout.CENTER);
		add(movesAreaScrollPane, BorderLayout.EAST);
		add(buttonsPanel, BorderLayout.SOUTH);
	}
	
	public BoardButtonsJPanel getButtonsPanel(){
		return buttonsPanel;
	}
	
	public MovesJTextArea getTextArea(){
		return movesArea;
	}
	
	public BoardJPanel getGraphicPanel(){
		return boardPanel;
	}
	
	public PlayingTape getPlayingTape(){
		return playingTape;
	}
	
	private static final long serialVersionUID = 1L;
	private BoardButtonsJPanel buttonsPanel;
	private MovesJTextArea movesArea = new MovesJTextArea();
	private BoardJPanel boardPanel;
	private PlayingTape playingTape;
	private JScrollPane movesAreaScrollPane = new JScrollPane(movesArea);
	private final static Dimension SIZE = new Dimension(700, 470);
	
	//////////TEMPORARY/////////////////////////////////////////////////
	public String classic_RuyLopez_PGN = "1. e4 e5 2. Nf3 Nc6 3. Bb5  a6 "+
	"4. Ba4 Nf6 5. O-O Be7 6. Re1 b5 7. Bb3 d6 8. c3 O-O 9. h3 Nb8  10. d4 Nbd7 "+
	"11. c4 c6 12. cxb5 axb5 13. Nc3 Bb7 14. Bg5 b4 15. Nb1 h6 16. Bh4 c5 17. dxe5 "+
	"Nxe4 18. Bxe7 Qxe7 19. exd6 Qf6 20. Nbd2 Nxd6 21. Nc4 Nxc4 22. Bxc4 Nb6 "+
	"23. Ne5 Rae8 24. Bxf7+ Rxf7 25. Nxf7 Rxe1+ 26. Qxe1 Kxf7 27. Qe3 Qg5 28. Qxg5 "+
	"hxg5 29. b3 Ke6 30. a3 Kd6 31. axb4 cxb4 32. Ra5 Nd5 33. f3 Bc8 34. Kf2 Bf5 "+
	"35. Ra7 g6 36. Ra6+ Kc5 37. Ke1 Nf4 38. g3 Nxh3 39. Kd2 Kb5 40. Rd6 Kc5 41. Ra6 "+
	"Nf2 42. g4 Bd3 43. Re6 1/2-1/2";
	
	public String fantasyPGN_promotionAndEnPassant = "1. e4 h5 2. e5 f5 3. exf5 4. f7+ Ke7 5. fxg8=N+ Rxg8";
	////////////////////////////////////////////////////////////////////////////////
}
